from zope.interface import Interface

class IPollerService(Interface):
    def parseMsg():
        """Returns a deferred returning a string, wich is the polling query"""

    def newConnection():
        """Handles the new connection, returns a deferred returning a string"""
    
    def closeConnection():
        """Cleans the connection's states"""

class IFakeNodeService(Interface):

    def getAnswer(msg, protocol_instance):
        """Returns a deferred returning a string."""

    def newConnection(protocol_instance, ipaddr):
        """Initializes the new connection"""

    def closeConnection(protocol_instance):
        """Cleans the closed connection's data"""

class IFakeNodeNetPlugin(Interface):
    
    def makeService():
        """Returns the service"""
    
    def getName():
        """Returns the name of the networking plugin"""

class INetPlugin(Interface):
    def makeService():
        """Returns the service"""

    def getName():
        """Returns the name of the networking plugin"""

class INetAlertPlugin(Interface):
    def makeService():
        """Returns the service"""

    def getName():
        """Returns the name of the networking plugin"""

class IDBPlugin(Interface):
    def getdb():
        """Returns the database handler class"""

class IDBClass(Interface):
    
    def getNodes():
        """Returns a deferred returning a list"""
    
    def getPlugins():
        """Returns a deferred returning a list"""
    
    def getValues():
        """Returns a deferred returning a dict"""
    
    def getLastValues():
        """Returns a deferred returning a dict"""

    def getNode_by_id():
        """Returns a deferred returning the node"""
    
    def insertValue():
        """Returns a deferred"""
    
    def insertPlugin():
        """Returns a deferred"""

    def insertItem():
        """Returns a deferred"""
    
    def updateNodeAddr():
        """Returns a deferred"""

    def updateNodeStatus():
        """Returns a deferred"""
    
    def getServer_by_relat():
        """Returns a deferred returning a server"""

    def updatePluginLast():
        """Returns a deferred"""

    def updatePluginStatus():
        """Returns a deferred"""
        
class INetworkFactory(Interface):

    def parseMsg():
        """Returns a deferred returning a string"""

    def newConnection():
        """Initializes the new connection; returns a deferred returning
        a string"""

    def closeConnection():
        """Cleans the closed connection's data"""

    def buildProtocol():
        """Returns a protocol returning a string"""

class IControllerService(Interface):

    def parseMsg():
        """Returns a deferred which will return the next request/command"""

    def newConnection():
        """Initializes the new connection; returns a deferred returning
        a string"""

    def closeConnection():
        """Cleans the closed connection's data"""

class IActionPlugin(Interface):

    def getName():
        """returns the plugin's name"""
        
    def configure():
        """the plugin gets the config file's contetns by this method"""
    
    def doAction():
        """Sends a warning message, or something like thad"""
